# include <bits/stdc++.h>
# define MAXN 100023
using namespace std;
inline int get_num() {
    int k = 0, f = 1;
    char c = getchar();
    for(; !isdigit(c); c = getchar()) if(c == '-') f = -1;
    for(; isdigit(c); c = getchar()) k = k * 10 + c - '0';
    return k * f;
}
struct edge {
    int to, ne;
    inline edge(){;}
    inline edge(int to_, int ne_) {
        to = to_, ne = ne;
    }
}e[MAXN];
int head[MAXN], n, m, cnt;
inline void addedge(int fr, int to) {
    e[++cnt] = edge(to, head[fr]), head[fr] = cnt;
    e[++cnt] = edge(fr, head[to]), head[to] = cnt;
}
int id, dfn[MAXN], low[MAXN], sta[MAXN], top, ins[MAXN];
bool isg[MAXN];
int ans = 0;
void Tarjan(int u, int fa) {
    dfn[u] = low[u] = ++id;
    int son = 0, v;
    for(int i = head[u]; i; i = e[i].ne) {
        if(!dfn[v = e[i].to]) {
            son++; Tarjan(v, u);
            low[u] = min(low[u], low[v]);
            if(low[v] >= dfn[u] && !isg[u]) {
                isg[u] = 1;
                ans++;
            }
        } else if(v != fa) {
            low[u] = min(low[u], dfn[v]);
        } 
    }
    if(son == 1 && fa < 0) {
        isg[u] = 0;
        ans--;
    }
}
int main() {
    n = get_num();
    m = get_num();
    for(int i = 1; i <= m; i++) {
        int u = get_num();
        int v = get_num();
        addedge(u ,v);
    }
    for(int i = 1; i <= n; i++) {
        if(!dfn[i]) Tarjan(i, -1);
    }
    printf("%d\n", ans);
    for(int i = 1; i <= n; i++) {
        if(isg[i]) printf("%d ", i);
    }
}
